package com.z.ssmdemo.controller;

import com.z.platform.actingModel.ProxyFactory;
import com.z.platform.controller.AbstractController;
import com.z.platform.controller.MyControllerResult;
import com.z.ssmdemo.constant.KeyContant;
import com.z.ssmdemo.service.UserService;
import com.z.ssmdemo.service.impl.UserServiceImpl;
import com.z.ssmdemo.log.factory.ELogger;
import com.z.ssmdemo.log.factory.LogFactory;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @author 21051
 */
public class UserController extends AbstractController {

    ELogger logger = LogFactory.getLog(UserController.class);
    @Override
    protected MyControllerResult service(HttpServletRequest req, HttpServletResponse resp) {
        String nickName = req.getParameter("nickName");
        String pazzword = req.getParameter("pazzword");
        //HttpSession session = req.getSession();
        //String userName = (String)session.getAttribute(KeyContant.USER_NAME_IN_SESSION);
        //logger.info("名字："+nickName );
        UserService userService = ProxyFactory.getProxy(UserServiceImpl.class);
        return MyControllerResult.ok(userService.getUser(nickName, pazzword));
    }
}
